3.1.13 \(\int \frac {\cos ^2(a+b x^2)}{x^2} \, dx\) [13]

Optimal. Leaf size=76 \[ -\frac {\cos ^2\left (a+b x^2\right )}{x}-\sqrt {b} \sqrt {\pi } \cos (2 a) S\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )-\sqrt {b} \sqrt {\pi } \text {FresnelC}\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right ) \sin (2 a) \]

[Out]

-cos(b*x^2+a)^2/x-cos(2*a)*FresnelS(2*x*b^(1/2)/Pi^(1/2))*b^(1/2)*Pi^(1/2)-FresnelC(2*x*b^(1/2)/Pi^(1/2))*sin(
2*a)*b^(1/2)*Pi^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {3475, 4669, 3454, 3434, 3433, 3432} \begin {gather*} -\sqrt {\pi } \sqrt {b} \sin (2 a) \text {FresnelC}\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )-\sqrt {\pi } \sqrt {b} \cos (2 a) S\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )-\frac {\cos ^2\left (a+b x^2\right )}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[a + b*x^2]^2/x^2,x]

[Out]

-(Cos[a + b*x^2]^2/x) - Sqrt[b]*Sqrt[Pi]*Cos[2*a]*FresnelS[(2*Sqrt[b]*x)/Sqrt[Pi]] - Sqrt[b]*Sqrt[Pi]*FresnelC
[(2*Sqrt[b]*x)/Sqrt[Pi]]*Sin[2*a]

Rule 3432

Int[Sin[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]/(f*Rt[d, 2]))*FresnelS[Sqrt[2/Pi]*Rt[d, 2
]*(e + f*x)], x] /; FreeQ[{d, e, f}, x]

Rule 3433

Int[Cos[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]/(f*Rt[d, 2]))*FresnelC[Sqrt[2/Pi]*Rt[d, 2
]*(e + f*x)], x] /; FreeQ[{d, e, f}, x]

Rule 3434

Int[Sin[(c_) + (d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Dist[Sin[c], Int[Cos[d*(e + f*x)^2], x], x] + Dist[
Cos[c], Int[Sin[d*(e + f*x)^2], x], x] /; FreeQ[{c, d, e, f}, x]

Rule 3454

Int[((a_.) + (b_.)*Sin[u_])^(p_.), x_Symbol] :> Int[(a + b*Sin[ExpandToSum[u, x]])^p, x] /; FreeQ[{a, b, p}, x
] && BinomialQ[u, x] &&  !BinomialMatchQ[u, x]

Rule 3475

Int[Cos[(a_.) + (b_.)*(x_)^(n_)]^(p_)*(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)*(Cos[a + b*x^n]^p/(m + 1)), x] +
 Dist[b*n*(p/(m + 1)), Int[Cos[a + b*x^n]^(p - 1)*Sin[a + b*x^n], x], x] /; FreeQ[{a, b}, x] && IGtQ[p, 1] &&
EqQ[m + n, 0] && NeQ[n, 1] && IntegerQ[n]

Rule 4669

Int[Cos[w_]^(p_.)*(u_.)*Sin[v_]^(p_.), x_Symbol] :> Dist[1/2^p, Int[u*Sin[2*v]^p, x], x] /; EqQ[w, v] && Integ
erQ[p]

Rubi steps

\begin {align*} \int \frac {\cos ^2\left (a+b x^2\right )}{x^2} \, dx &=-\frac {\cos ^2\left (a+b x^2\right )}{x}-(4 b) \int \cos \left (a+b x^2\right ) \sin \left (a+b x^2\right ) \, dx\\ &=-\frac {\cos ^2\left (a+b x^2\right )}{x}-(2 b) \int \sin \left (2 \left (a+b x^2\right )\right ) \, dx\\ &=-\frac {\cos ^2\left (a+b x^2\right )}{x}-(2 b) \int \sin \left (2 a+2 b x^2\right ) \, dx\\ &=-\frac {\cos ^2\left (a+b x^2\right )}{x}-(2 b \cos (2 a)) \int \sin \left (2 b x^2\right ) \, dx-(2 b \sin (2 a)) \int \cos \left (2 b x^2\right ) \, dx\\ &=-\frac {\cos ^2\left (a+b x^2\right )}{x}-\sqrt {b} \sqrt {\pi } \cos (2 a) S\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )-\sqrt {b} \sqrt {\pi } C\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right ) \sin (2 a)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.11, size = 76, normalized size = 1.00 \begin {gather*} -\frac {\cos ^2\left (a+b x^2\right )+\sqrt {b} \sqrt {\pi } x \cos (2 a) S\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right )+\sqrt {b} \sqrt {\pi } x \text {FresnelC}\left (\frac {2 \sqrt {b} x}{\sqrt {\pi }}\right ) \sin (2 a)}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[a + b*x^2]^2/x^2,x]

[Out]

-((Cos[a + b*x^2]^2 + Sqrt[b]*Sqrt[Pi]*x*Cos[2*a]*FresnelS[(2*Sqrt[b]*x)/Sqrt[Pi]] + Sqrt[b]*Sqrt[Pi]*x*Fresne
lC[(2*Sqrt[b]*x)/Sqrt[Pi]]*Sin[2*a])/x)

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 62, normalized size = 0.82

method result size
default \(-\frac {1}{2 x}-\frac {\cos \left (2 b \,x^{2}+2 a \right )}{2 x}-\sqrt {b}\, \sqrt {\pi }\, \left (\cos \left (2 a \right ) \mathrm {S}\left (\frac {2 x \sqrt {b}}{\sqrt {\pi }}\right )+\sin \left (2 a \right ) \FresnelC \left (\frac {2 x \sqrt {b}}{\sqrt {\pi }}\right )\right )\) \(62\)
risch \(-\frac {1}{2 x}-\frac {i {\mathrm e}^{-2 i a} b \sqrt {\pi }\, \sqrt {2}\, \erf \left (\sqrt {2}\, \sqrt {i b}\, x \right )}{4 \sqrt {i b}}+\frac {i {\mathrm e}^{2 i a} b \sqrt {\pi }\, \erf \left (\sqrt {-2 i b}\, x \right )}{2 \sqrt {-2 i b}}-\frac {\cos \left (2 b \,x^{2}+2 a \right )}{2 x}\) \(83\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(b*x^2+a)^2/x^2,x,method=_RETURNVERBOSE)

[Out]

-1/2/x-1/2/x*cos(2*b*x^2+2*a)-b^(1/2)*Pi^(1/2)*(cos(2*a)*FresnelS(2*x*b^(1/2)/Pi^(1/2))+sin(2*a)*FresnelC(2*x*
b^(1/2)/Pi^(1/2)))

________________________________________________________________________________________

Maxima [C] Result contains complex when optimal does not.
time = 0.56, size = 83, normalized size = 1.09 \begin {gather*} \frac {\sqrt {2} \sqrt {b x^{2}} {\left ({\left (-\left (i + 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, 2 i \, b x^{2}\right ) + \left (i - 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, -2 i \, b x^{2}\right )\right )} \cos \left (2 \, a\right ) + {\left (\left (i - 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, 2 i \, b x^{2}\right ) - \left (i + 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, -2 i \, b x^{2}\right )\right )} \sin \left (2 \, a\right )\right )} - 8}{16 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x^2+a)^2/x^2,x, algorithm="maxima")

[Out]

1/16*(sqrt(2)*sqrt(b*x^2)*((-(I + 1)*sqrt(2)*gamma(-1/2, 2*I*b*x^2) + (I - 1)*sqrt(2)*gamma(-1/2, -2*I*b*x^2))
*cos(2*a) + ((I - 1)*sqrt(2)*gamma(-1/2, 2*I*b*x^2) - (I + 1)*sqrt(2)*gamma(-1/2, -2*I*b*x^2))*sin(2*a)) - 8)/
x

________________________________________________________________________________________

Fricas [A]
time = 0.38, size = 66, normalized size = 0.87 \begin {gather*} -\frac {\pi x \sqrt {\frac {b}{\pi }} \cos \left (2 \, a\right ) \operatorname {S}\left (2 \, x \sqrt {\frac {b}{\pi }}\right ) + \pi x \sqrt {\frac {b}{\pi }} \operatorname {C}\left (2 \, x \sqrt {\frac {b}{\pi }}\right ) \sin \left (2 \, a\right ) + \cos \left (b x^{2} + a\right )^{2}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x^2+a)^2/x^2,x, algorithm="fricas")

[Out]

-(pi*x*sqrt(b/pi)*cos(2*a)*fresnel_sin(2*x*sqrt(b/pi)) + pi*x*sqrt(b/pi)*fresnel_cos(2*x*sqrt(b/pi))*sin(2*a)
+ cos(b*x^2 + a)^2)/x

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cos ^{2}{\left (a + b x^{2} \right )}}{x^{2}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x**2+a)**2/x**2,x)

[Out]

Integral(cos(a + b*x**2)**2/x**2, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x^2+a)^2/x^2,x, algorithm="giac")

[Out]

integrate(cos(b*x^2 + a)^2/x^2, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\cos \left (b\,x^2+a\right )}^2}{x^2} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(a + b*x^2)^2/x^2,x)

[Out]

int(cos(a + b*x^2)^2/x^2, x)

________________________________________________________________________________________